/****************************************************************************
**
** SpellbookGump.h
**
** Copyright (C) August 2014 Hotride
**
** This program is free software; you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation; either version 2 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
** GNU General Public License for more details.
**
*****************************************************************************
*/
//---------------------------------------------------------------------------
#ifndef SpellbookGumpH
#define SpellbookGumpH
//---------------------------------------------------------------------------
class TSpellbookGump
{
private:
	TEXT_TEXTURE_HEADER m_TextIndex;
	TEXT_TEXTURE_HEADER m_TextReagents;
	TEXT_TEXTURE_HEADER m_TextCircle[8];
	TEXT_TEXTURE_HEADER m_TextReagent[8];
	TEXT_TEXTURE_HEADER m_TextSpell[64];

	static WORD m_ReagentsIndex[8];

	int GetReagentIndex(WORD &ID);
	
	void DrawTextTexture(TEXT_TEXTURE_HEADER &th, int X, int Y);

public:
	TSpellbookGump() {}
	~TSpellbookGump() {}

	void InitTextTextures();
	void ReleaseTextTextures();
	
	int Draw(bool &mode, TGump *gump);

	void GenerateFrame(TGump *gump, float PosX, float PosY);

	void OnButtonUp(TGump *gump);
	bool OnLeftDoubleClick(TGump *gump);
};
//---------------------------------------------------------------------------
#endif